let init = 0;

export default function CangReducer(state=init, action){
    switch (action.type) {
        // {type: 'add', data: 1}
        case 'add':
            return state + action.data;
        // {type: 'minus', data: 1}
        case 'minus':
            return state - action.data;
        default:
            return state; //这一行代码必须要加上
    }
}